package com.zhengxin.one.controller;

import com.alibaba.fastjson.JSON;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zhengxin.one.common.Result;
import com.zhengxin.one.common.ResultPage;
import com.zhengxin.one.dto.*;
import com.zhengxin.one.dto.CreateOrderDTO;
import com.zhengxin.one.dto.tokenInfoDTO;
import com.zhengxin.one.dto.vo.*;
import com.zhengxin.one.entity.BillAccumulation;
import com.zhengxin.one.entity.BillSociety;
import com.zhengxin.one.entity.Order;
import com.zhengxin.one.entity.TSoAc;
import com.zhengxin.one.entity.client.RecordAdd;
import com.zhengxin.one.entity.entityClass.Page;
import com.zhengxin.one.mapper.PolicyAddrMapper;
import com.zhengxin.one.service.impl.UserServiceIpml;
import com.zhengxin.one.utils.HttpUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;

import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;


@RestController
@RequestMapping(value = "shangshebao")
public class RepairPayController {
    private final Logger log = LoggerFactory.getLogger(BillController.class);
    @Autowired
    private UserServiceIpml userService;

    private static String app="appkey=";
    private static String appkey="2a7f0d5N13Y9deT6";
    //服务费
    public static int SERVICECOST=200;
    //第三方授权码
    public static String AUTHCODE="3db06a35534e7b7920a3415cf13ff038";

    @Autowired
    private PolicyAddrMapper policyAddrMapper;


    public String getCompanyName(String useId) {
        return policyAddrMapper.getNameC(useId);
    }

    //获取补缴列表
    @RequestMapping(value = "getRepairList",method = RequestMethod.GET)
    public ResultPage getBase(@RequestParam String keyword,@RequestParam String companyId, @RequestParam int page, @RequestParam int size){
        //获取列表
        PageHelper.startPage(page,size);
        List<RepairPayListVO> repairPayListVOS = policyAddrMapper.foundList(companyId, keyword);
        PageInfo pageInfo = new PageInfo(repairPayListVOS);
        Page pageinfos =new Page();
        pageinfos.setPageNum(pageInfo.getPageNum());
        pageinfos.setTotal((int)pageInfo.getTotal());
        if(repairPayListVOS.size()>0){
            for (RepairPayListVO x :repairPayListVOS) {
                BillSociety so = policyAddrMapper.getSo(x.getIdCard());
                BillAccumulation ac = policyAddrMapper.getAc(x.getIdCard());
                x.setBillSociety(so);
                x.setBillAccumulation(ac);
            }
        }else {
            return ResultPage.successp("没有相关参数","");
        }
        return ResultPage.successp(repairPayListVOS,pageinfos);
    }
    //获取补缴方案参数信息
    @RequestMapping(value = "getRepairInfo",method = RequestMethod.GET)
    public Result getRepairInfo(@RequestParam String idCard){
        RepairInfoBackVO repairInfoBackVO = new RepairInfoBackVO();
        repairInfoBackVO.setIdCard(idCard);
        //获取方案名称
        Map<String, String> caseSo = policyAddrMapper.getCaseName(idCard, 1);
        //根据方案名查他的方案id
        Map<String, String> planSo = policyAddrMapper.getCaseId(caseSo.get("plan"), 1);
        //根据方案id查出险种拼接
        List<Map<String, String>> product_code = policyAddrMapper.getSupp(planSo.get("id"),1);
        String code=null;
        int i=0;
        for (Map<String,String> x:product_code) {
                    if(i>0){
                       code=code+","+x.get("item_type_code");
                    }else {
                        code=x.get("item_type_code");
                    }
            i++;
        }
        TSoAc map = policyAddrMapper.suppInfo(code, 1);

        RepairInfosBackVO repairInfosBackVO = new RepairInfosBackVO();
        repairInfosBackVO.setRegion(caseSo.get("region"));
        repairInfosBackVO.setPlan(caseSo.get("plan"));
        repairInfosBackVO.setSupp_base_rule_code(map.getSupp_base_rule_code());
        if("40006003".equals(map.getSupp_base_rule_code())){
            //根据id查基数
            repairInfosBackVO.setCbase(policyAddrMapper.getCbase(idCard,1));
        }
        if("40006002".equals(map.getSupp_base_rule_code())){
            repairInfosBackVO.setBase_min_amt(map.getBase_min_amt());
            repairInfosBackVO.setBase_max_amt(map.getBase_max_amt());
        }
        repairInfoBackVO.setSoInfo(repairInfosBackVO);

        //获取方案名称
        Map<String, String> caseAc = policyAddrMapper.getCaseName(idCard, 2);
        //根据方案名查他的方案id
        Map<String, String> planAc = policyAddrMapper.getCaseId(caseAc.get("plan"), 2);
        //根据方案id查出险种拼接
        List<Map<String, String>> product_code1 = policyAddrMapper.getSupp(planAc.get("id"),2);
        String code1=null;
        int i1=0;
        for (Map<String,String> x:product_code1) {
            if(i1>0){
                code1=code1+","+x.get("item_type_code");
            }else {
                code1=x.get("item_type_code");
            }
            i1++;
        }
        TSoAc map1 = policyAddrMapper.suppInfo(code1, 2);
        RepairInfosBackVO repairInfosBackVO1 = new RepairInfosBackVO();
        repairInfosBackVO1.setRegion(caseAc.get("region"));
        repairInfosBackVO1.setPlan(caseAc.get("plan"));
        repairInfosBackVO1.setSupp_base_rule_code(map1.getSupp_base_rule_code());
        if("40006003".equals(map1.getSupp_base_rule_code())){
            //根据id查基数
            repairInfosBackVO1.setCbase(policyAddrMapper.getCbase(idCard,1));
        }
        if("40006002".equals(map1.getSupp_base_rule_code())){
            repairInfosBackVO1.setBase_min_amt(map1.getBase_min_amt());
            repairInfosBackVO1.setBase_max_amt(map1.getBase_max_amt());
        }
        repairInfoBackVO.setAcInfo(repairInfosBackVO1);
        return Result.success(repairInfoBackVO);
    }
    //提交补缴信息
    @RequestMapping(value = "upRepairInfo",method = RequestMethod.POST)
    public Result upRepairInfo(@RequestBody RepairVO repairVO){
        RepairOrderViewBackVO repairOrderViewBackVO = new RepairOrderViewBackVO();
        repairOrderViewBackVO.setIdCard(repairVO.getIdCard());
        if(repairVO.getRepairType().contains("1")){
            //先判断是否需要补缴
            int i = policyAddrMapper.foundOrderById(repairVO.getIdCard(), repairVO.getRepairTimeSo(), 1);
            if(i!=0){
                return Result.fail("社保订单不能补缴");
            }
            //生成预览订单
            RepairViewSoVO repairViewSoVO = new RepairViewSoVO();
            repairViewSoVO.setRegion(repairVO.getRepairRegionSo());
            repairViewSoVO.setBase(repairVO.getRepairBaseSo());
            //查询方案下的险种
            List<caseInfoDTO> caseInfos = policyAddrMapper.getCaseInfos(repairVO.getRepairPlanSo(), 1);
            String info="单位缴纳：";
            String info1="个人缴纳：";
            Double soTatol=0.00;
            for ( caseInfoDTO x:caseInfos) {
                if("40002001".equals(x.getItemTypeCode())){
                    String yaolao=info+x.getCompRatio()*0.01*repairVO.getRepairBaseSo()+" "+info1+x.getEmpRatio()*0.01*repairVO.getRepairBaseSo();
                    repairViewSoVO.setYangLaoC(info+x.getCompRatio()*0.01*repairVO.getRepairBaseSo());
                    repairViewSoVO.setYangLaoP(info1+x.getEmpRatio()*0.01*repairVO.getRepairBaseSo());
                    soTatol+=repairVO.getRepairBaseSo()*x.getCompRatio()*0.01+repairVO.getRepairBaseSo()*x.getEmpRatio()*0.01;
                }
                if("40002002".equals(x.getItemTypeCode())){
                    String gongshang=info+x.getCompRatio()*0.01*repairVO.getRepairBaseSo()+" "+info1+x.getEmpRatio()*0.01*repairVO.getRepairBaseSo();
                    repairViewSoVO.setGongShangC(info+x.getCompRatio()*0.01*repairVO.getRepairBaseSo());
                    repairViewSoVO.setGongShangP(info1+x.getEmpRatio()*0.01*repairVO.getRepairBaseSo());
                    soTatol+=repairVO.getRepairBaseSo()*x.getCompRatio()*0.01+repairVO.getRepairBaseSo()*x.getEmpRatio()*0.01;
                }
                if("40002003".equals(x.getItemTypeCode())){
                    String yiliao=info+x.getCompRatio()*0.01*repairVO.getRepairBaseSo()+" "+info1+x.getEmpRatio()*0.01*repairVO.getRepairBaseSo();
                    repairViewSoVO.setYiLiaoC(info+x.getCompRatio()*0.01*repairVO.getRepairBaseSo());
                    repairViewSoVO.setYiLiaoP(info1+x.getEmpRatio()*0.01*repairVO.getRepairBaseSo());
                    soTatol+=repairVO.getRepairBaseSo()*x.getCompRatio()*0.01+repairVO.getRepairBaseSo()*x.getEmpRatio()*0.01;
                }
                if("40002004".equals(x.getItemTypeCode())){
                    String shiye=info+x.getCompRatio()*0.01*repairVO.getRepairBaseSo()+" "+info1+x.getEmpRatio()*0.01*repairVO.getRepairBaseSo();
                    repairViewSoVO.setShiYeC(info+x.getCompRatio()*0.01*repairVO.getRepairBaseSo());
                    repairViewSoVO.setShiYeP(info1+x.getEmpRatio()*0.01*repairVO.getRepairBaseSo());
                    soTatol+=repairVO.getRepairBaseSo()*x.getCompRatio()*0.01+repairVO.getRepairBaseSo()*x.getEmpRatio()*0.01;
                }
                if("40002005".equals(x.getItemTypeCode())){
                    String shengyu=info+x.getCompRatio()*0.01*repairVO.getRepairBaseSo()+" "+info1+x.getEmpRatio()*0.01*repairVO.getRepairBaseSo();
                    repairViewSoVO.setShengYuC(info+x.getCompRatio()*0.01*repairVO.getRepairBaseSo());
                    repairViewSoVO.setShengYuP(info1+x.getEmpRatio()*0.01*repairVO.getRepairBaseSo());
                    soTatol+=repairVO.getRepairBaseSo()*x.getCompRatio()*0.01+repairVO.getRepairBaseSo()*x.getEmpRatio()*0.01;
                }
            }
            repairViewSoVO.setSoTotal(soTatol);
            repairViewSoVO.setDateTime(repairVO.getRepairTimeSo());
            repairViewSoVO.setNumber(1);
            repairViewSoVO.setRepairTotal(soTatol);
            repairOrderViewBackVO.setSoInfo(repairViewSoVO);
        }
        if(repairVO.getRepairType().contains("2")){
            int j = policyAddrMapper.foundOrderById(repairVO.getIdCard(), repairVO.getRepairTimeSo(), 2);
            if(j!=0){
                return Result.fail("公积金订单不能补缴");
            }
            //生成预览订单
            RepairViewAcVO repairViewAcVO = new RepairViewAcVO();
            repairViewAcVO.setRegion(repairVO.getRepairRegionAc());
            repairViewAcVO.setBase(repairVO.getRepairBaseAc());
            repairViewAcVO.setDateTime(repairVO.getRepairTimeAc());
            repairViewAcVO.setCompanyPay(repairVO.getRepairBaseAc()* repairVO.getCompanyBaseAc()*0.01);
            repairViewAcVO.setPersonPay(repairVO.getRepairBaseAc()* repairVO.getPresonBaseAc()*0.01);
            repairViewAcVO.setAcTotal(repairVO.getRepairBaseAc()* repairVO.getCompanyBaseAc()*0.01+repairVO.getRepairBaseAc()* repairVO.getPresonBaseAc()*0.01);
            repairViewAcVO.setRepairTotal(repairVO.getRepairBaseAc()* repairVO.getCompanyBaseAc()*0.01+repairVO.getRepairBaseAc()* repairVO.getPresonBaseAc()*0.01);
            repairViewAcVO.setNumber(1);
            repairOrderViewBackVO.setAcInfo(repairViewAcVO);
        }
        return Result.success(repairOrderViewBackVO);
    }
    //先生成sign
    public static String getSign(CreateOrderDTO createOrderDTO) throws NoSuchAlgorithmException {
        ArrayList<Object> objects = new ArrayList<>();
        objects.add("amount="+createOrderDTO.getAmount()+"&");
        objects.add("auth_code="+createOrderDTO.getAuth_code()+"&");
        objects.add("deduction_amount="+createOrderDTO.getDeduction_amount()+"&");
        objects.add("order_item="+createOrderDTO.getOrder_item()+"&");
        objects.add("order_type="+createOrderDTO.getOrder_type()+"&");
        objects.add("payment_amount="+createOrderDTO.getPayment_amount()+"&");
        objects.add("service_fee="+createOrderDTO.getService_fee()+"&");
        objects.add("shipping_fee="+createOrderDTO.getShipping_fee()+"&");
        objects.add("sign_time="+createOrderDTO.getSign_time()+"&");
        objects.add("userid="+createOrderDTO.getUserid()+"&");
        objects.add(app+appkey);
        String infos= new String();
        // 加密对象，指定加密方式
        for (Object x :objects){
            infos+=x;
        }
        String replace = infos.replace("\\", "");
        byte[] md5s = MessageDigest.getInstance("md5").digest(
                replace.getBytes());
        String md5code = new BigInteger(1, md5s).toString(16);
        for (int i = 0; i < 32 - md5code.length(); i++) {
            md5code = "0" + md5code;
        }
        return md5code;

    }
    //获取token方法
    public String getToken(){
        //获取token
        tokenDTO tokenDTO = new tokenDTO();
        tokenDTO.setChecked(1);
        tokenDTO.setPassword("a123456");
        tokenDTO.setLogin_type("enterprise");
        tokenDTO.setUsername("weilai");
        tokenDTO.setReferer_url("http://archive.renshihr.com");
        String token = JSON.toJSONString(tokenDTO);
        String substring = null;
        try{
            String s3 = HttpUtil.sendPost1("https://tpa.renshihr.cn/api/user/login?referer_url=archive.reshihr.cn", token, null);
            tokenInfoDTO jsonObject = JSON.parseObject(s3, tokenInfoDTO.class);
            Map<String, Object> obj = jsonObject.getObj();
            String referer_url = obj.get("referer_url").toString();
            int i = referer_url.indexOf("=");
            int a = referer_url.indexOf("&");
            substring = referer_url.substring(i+1, a);
        }catch (Exception e){e.getMessage();}
        return substring;
    }
    //创建补缴订单
    @RequestMapping(value = "createRepairOrder",method = RequestMethod.POST)
    @Transactional(rollbackFor = Exception.class)
    public Result createRepairOrder(@RequestBody RepairOrderVO repairOrderVO ) throws NoSuchAlgorithmException {
        //添加历史记录信息
        RecordAdd recordAdd = new RecordAdd();
        recordAdd.setCompany_name(getCompanyName(repairOrderVO.getUserId()));
        recordAdd.setCompany_id(repairOrderVO.getUserId());
        recordAdd.setName(repairOrderVO.getName());
        recordAdd.setId_card(repairOrderVO.getIdCard());
        if(repairOrderVO.getRepairType().contains("1")){
            recordAdd.setService_type(1);
            recordAdd.setHandle_type(5);
            recordAdd.setStatus(1);
            recordAdd.setTtype(4);
            int i2 = userService.setPersonD(recordAdd);
        }
        if(repairOrderVO.getRepairType().contains("2")){
            recordAdd.setService_type(2);
            recordAdd.setHandle_type(5);
            recordAdd.setStatus(1);
            recordAdd.setTtype(4);
            int i2 = userService.setPersonD(recordAdd);
        }
        if(repairOrderVO.getRepairType().contains("3")){
            recordAdd.setService_type(3);
            recordAdd.setHandle_type(5);
            recordAdd.setStatus(1);
            recordAdd.setTtype(4);
            int i2 = userService.setPersonD(recordAdd);
        }

        //获取token
        String token = getToken();
        //订单最外层
        CreateOrderDTO createOrderDTO = new CreateOrderDTO();
        createOrderDTO.setUserid(Integer.parseInt(repairOrderVO.getUserId()));
        createOrderDTO.setOrder_type(3);
        createOrderDTO.setDeduction_amount(0);
        createOrderDTO.setAddress("");
        createOrderDTO.setShipping_fee(SERVICECOST*100);
        createOrderDTO.setAmount((int) ((repairOrderVO.getAcTotal()+repairOrderVO.getSoTotal())*100));
        createOrderDTO.setPayment_amount((int) ((repairOrderVO.getAcTotal()+repairOrderVO.getSoTotal())*100));
        createOrderDTO.setMemo("");
        createOrderDTO.setAuth_code(AUTHCODE);
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd");
        Timestamp timestamp = new Timestamp(System.currentTimeMillis());
        long time = timestamp.getTime();
        createOrderDTO.setSign_time(BigInteger.valueOf(time));
        //订单的中成（要改下一个参数）
        CreateOrderInfoVO createOrderInfoVO = new CreateOrderInfoVO();
        createOrderInfoVO.setApplication_number(6);
        createOrderInfoVO.setSubtitle("商社保");
        createOrderInfoVO.setQuantity(1);
        createOrderInfoVO.setPrice((int) ((repairOrderVO.getAcTotal()+repairOrderVO.getSoTotal())*100));
        createOrderInfoVO.setService_price(SERVICECOST*100);
        createOrderInfoVO.setPerson_number(1);
        createOrderInfoVO.setOrder_item_type(4);
        createOrderInfoVO.setMemo("");
        //最内层补缴Vo
        CreateOrderRepairVO createOrderRepairVO = new CreateOrderRepairVO();
        createOrderRepairVO.setName(repairOrderVO.getName());
        createOrderRepairVO.setIdentity_number(repairOrderVO.getIdCard());
        createOrderRepairVO.setAmount((int) ((repairOrderVO.getAcTotal()+repairOrderVO.getSoTotal())*100));
        if(repairOrderVO.getRepairType().contains("1")){
            createOrderRepairVO.setInsurance_for_year_month_begin(repairOrderVO.getRepairTimeSo());
            createOrderRepairVO.setInsurance_for_year_month_end(repairOrderVO.getRepairTimeSo());
            createOrderRepairVO.setInsurance_months(1);
        }else {
            createOrderRepairVO.setInsurance_for_year_month_begin(null);
            createOrderRepairVO.setInsurance_for_year_month_end(null);
            createOrderRepairVO.setInsurance_months(0);
        }


        createOrderRepairVO.setInsurance_amount((int) ((repairOrderVO.getSoTotal())*100));
        if(repairOrderVO.getRepairType().contains("2")){
            createOrderRepairVO.setReservefunds_for_year_month_begin(repairOrderVO.getRepairTimeAc());
            createOrderRepairVO.setReservefunds_for_year_month_end(repairOrderVO.getRepairTimeAc());
            createOrderRepairVO.setReservefunds_months(1);
        }else {
            createOrderRepairVO.setReservefunds_for_year_month_begin(null);
            createOrderRepairVO.setReservefunds_for_year_month_end(null);
            createOrderRepairVO.setReservefunds_months(0);
        }

        createOrderRepairVO.setReservefunds_amount((int) ((repairOrderVO.getAcTotal())*100));

        ArrayList<CreateOrderRepairVO> createOrderRepairVOArrayList = new ArrayList<>();
        createOrderRepairVOArrayList.add(createOrderRepairVO);
        createOrderInfoVO.setOrder_item_detail(createOrderRepairVOArrayList);
        ArrayList<CreateOrderInfoVO> createOrderInfoVOArrayList = new ArrayList<>();
        createOrderInfoVOArrayList.add(createOrderInfoVO);
        createOrderDTO.setOrder_item(JSON.toJSONString(createOrderInfoVOArrayList));
        String sign = getSign(createOrderDTO);
        createOrderDTO.setSign(sign);
        String s1 = JSON.toJSONString(createOrderDTO);
        System.out.println(s1);
        String orderID=null;
        try {
            String info = HttpUtil.sendPost("https://openapi.renshihr.cn/v1/order/add",s1,token);
            System.out.println(info);
            OrderBackDTO jsonObject = JSON.parseObject(info,OrderBackDTO.class);
            if(!"E00000".equals(jsonObject.getStatus_code())){
                return Result.fail("创建人事云订单失败");
            }
            orderID = jsonObject.getResult_data().get("order_info").get("order_number");
            System.out.println(orderID);
        }catch (Exception e)
        {e.getMessage();}
        //生成本地订单
        KeepListDTO keepListDTO = new KeepListDTO();
        keepListDTO.setName(repairOrderVO.getName());
        keepListDTO.setUserId(repairOrderVO.getUserId());
        keepListDTO.setIdCard(repairOrderVO.getIdCard());
        keepListDTO.setOrderStates(repairOrderVO.getRepairType());
        keepListDTO.setServiceFee(SERVICECOST);
        keepListDTO.setOrder_info("补缴");
        keepListDTO.setName(repairOrderVO.getName());
        if(repairOrderVO.getRepairType().contains("1")){
            Map<String, String> caseName = policyAddrMapper.getCaseName(repairOrderVO.getIdCard(), 1);
            //查询方案下的险种
            List<caseInfoDTO> caseInfos = policyAddrMapper.getCaseInfos(caseName.get("plan"), 1);
            double comPay=0.00;
            double perPay=0.00;
            for ( caseInfoDTO x:caseInfos) {
                comPay+=x.getCompM()*repairOrderVO.getRepairBaseSo();
                perPay+=x.getEmpM()*repairOrderVO.getRepairBaseSo();
            }
            keepListDTO.setSo_company(comPay);
            keepListDTO.setSo_person(perPay);
        }
        if(repairOrderVO.getRepairType().contains("2")){
            keepListDTO.setAc_company(repairOrderVO.getRepairBaseAc()*repairOrderVO.getCompanyBaseAc());
            keepListDTO.setAc_person(repairOrderVO.getRepairBaseAc()*repairOrderVO.getPresonBaseAc());
        }
        if(repairOrderVO.getRepairType().contains("1")){
            keepListDTO.setDateTime(repairOrderVO.getRepairTimeSo());
        }else {
            keepListDTO.setDateTime(repairOrderVO.getRepairTimeAc());
        }
        keepListDTO.setTotalPay(repairOrderVO.getAcTotal()+repairOrderVO.getSoTotal());
        keepListDTO.setUuid(orderID);
        try{
            policyAddrMapper.insertOrder(keepListDTO);
        }catch (Exception e){
            e.getMessage();
        }
        //设置返回值
        KeepBackDTO keepBackDTO = new KeepBackDTO();
        KeepBackInfoDTO keepBackInfoDTO1 = new KeepBackInfoDTO();
        KeepBackInfoDTO keepBackInfoDTO2 = new KeepBackInfoDTO();
        keepBackDTO.setName(repairOrderVO.getName());
        keepBackDTO.setOrderId(orderID);
        keepBackDTO.setIdCard(repairOrderVO.getIdCard());
        keepBackDTO.setAmount(repairOrderVO.getAcTotal()+repairOrderVO.getSoTotal());
        keepBackDTO.setServicePay(SERVICECOST);
        if(repairOrderVO.getRepairType().contains("1")){
            keepBackDTO.setOrderText("社商公积金补缴"+repairOrderVO.getRepairTimeSo()+"(1人)");
        }else {
            keepBackDTO.setOrderText("社商公积金补缴"+repairOrderVO.getRepairTimeAc()+"(1人)");
        }
        if(repairOrderVO.getRepairType().contains("1")){
            keepBackInfoDTO1.setFor_year_month(repairOrderVO.getRepairTimeSo());
            keepBackInfoDTO1.setAmount(repairOrderVO.getSoTotal());
            keepBackDTO.setSo(keepBackInfoDTO1);
        }
        if(repairOrderVO.getRepairType().contains("2")){
            keepBackInfoDTO2.setFor_year_month(repairOrderVO.getRepairTimeAc());
            keepBackInfoDTO2.setAmount(repairOrderVO.getAcTotal());
            keepBackDTO.setAc(keepBackInfoDTO2);
        }
        return Result.success(keepBackDTO);
    }
    //在缴明细列表
    @RequestMapping(value = "getDoList",method = RequestMethod.GET)
    public Result getDoList(@RequestParam String userId,@RequestParam String dateTime,@RequestParam String keyword,@RequestParam int page, @RequestParam int size){
        //获取同一月下的所有订单信息
        List<Order> keepInfo = policyAddrMapper.getKeepInfo(keyword, dateTime, userId);
        return Result.success(keepInfo);
    }

}
